<?php

namespace app\web\validate;

use think\Validate;

class CardValidate extends Validate
{
    protected $rule = [
        'bank_id'                  => 'require|integer|max:11',
        'bank_name'                => 'require|chsAlphaNum|max:40',
        'full_card_number'         => 'require|integer|max:20',
        'name_on_card'             => 'require|chsAlphaNum|max:20',
        'credit_mobile'            => 'require|mobile|max:11',
        'credit_valid_date'        => 'require|dateFormat:m/y|max:32',
        'id_number'                => 'require|max:18',
        'credit_verification_code' => 'require|integer|length:3',
    ];
    //字段描述
    protected $field = [
        'bank_id'                  => '银行id',
        'bank_name'                => '银行名称',
        'full_card_number'         => '卡号',
        'name_on_card'             => '持卡人姓名',
        'credit_mobile'            => '手机号',
        'credit_valid_date'        => '有效期',
        'id_number'                => '身份证号',
        'credit_verification_code' => '银行卡验证码',
    ];
    protected $message = [
    ];
    //验证场景
    protected $scene = [
        'create' => ['bank_id', 'bank_name', 'full_card_number', 'name_on_card', 'bill_date',
                     'credit_mobile', 'credit_valid_date', 'id_number', 'credit_verification_code'],
    ];

}